package cn.ito.zjgsu.domain.wrapper;

import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSON;

import cn.ito.zjgsu.domain.View;

public class ViewWrapper {
	private View view;

	public View getView() {
		return view;
	}

	public void setView(View view) {
		this.view = view;
	}
	
	
	public ViewWrapper(){}
	public ViewWrapper(View view){
		this.view = view;
	}
	
	public static List<ViewWrapper> wrapList(List<View> views){
		List<ViewWrapper> vws = new ArrayList<ViewWrapper>();
		for(View view : views){
			vws.add(new ViewWrapper(view));
		}
		return vws;
	}
	
	public static String toJsonArrayString(List<ViewWrapper> viewWrappers){
		return JSON.toJSONString(viewWrappers);
	}
	public  String toJsonString(){
		return JSON.toJSONString(this);
	}
	
}
